<include file="public@header"/>
<style>
	/*table{ border:1px solid #000; width:80%; font-size:1rem; margin-bottom:20px}
	td{border:1px solid #000; padding:0 5px; height:2rem; text-align:center}*/
	tr td input,tr td select{width:80px;}
	.content_nav .check_info{flex:1; display:flex;flex-direction: column;align-items: center;justify-content: center;}
	.form-horizontal .control-group1.group_left{width:50%;}
	.form-horizontal .group_left .control-label{width:90px;}
	.form-horizontal .group_left .controls{margin-left:100px;}
	.form-horizontal .control-group1 {
		float: left;
		width: 15%;
		margin-bottom: 20px;
	}
	.form-horizontal .control-label {width:80px;}
	.form-horizontal .controls {margin-left:90px;}
	input,select, textarea, .uneditable-input {
		max-width: 580px;
		width:100px;
		min-width:auto;
	}
</style>
</head>
<body>
	<php>$page='';$vo['id']='';</php>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('Aftersale/paperwork')}">证件业务</a></li>
		</ul>
        <form class="form-horizontal" action="{:url('Aftersale/paperwork')}" method="post" enctype="multipart/form-data">
        <fieldset>
            <input type="hidden" class="form-control" id="status" name="status" value="0">
            <input type="hidden" class="form-control" id="types" name="types" value="change">
        	<!--改版画面-->
        <div class="div_title"><span>客户概览</span></div>
        <div class="control-group1-p div_content">
            <div class="col-md-12">
                <div class="form-group">
                    <label class="control-label" >客户姓名</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.buyer_name}" disabled>
                    </div>
                    <label class="control-label">持证类型</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{:cart_type('cart',$result.cart_type)}" disabled>
                    </div>
                    <label class="control-label">证件号码</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.customer_account}" disabled>
                    </div>
                    <label class="control-label">联系电话</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.buyer_phone}" disabled>
                    </div>
                    <label class="control-label">联系地址</label>
                    <div class="col-md-4" style="width: 31.5%;">
                        <input type="text" class="form-control" value="{$result.customer_address}" style="width:80%;" disabled>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">合同编号</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.contract_sn}" disabled>
                    </div>
                    <label class="control-label">购买日期</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.gm_start_time}" disabled>
                    </div>
                    <label class="control-label">打证日期</label>
                    <div class="col-md-2"style="width: 11%">
                        <input type="text" class="form-control" value="{$result.dz_start_time}" disabled>
                    </div>
                    <label class="control-label">保修状态</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.bxq_status}" disabled>
                    </div>
                    <label class="control-label">当前状态</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.buyer_phone}" disabled>
                    </div>
                    <label class="control-label">维护期</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.whq_status}" disabled>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label">墓位编号</label>
                    <div class="col-md-2"  style="width: 11%">
                        <input type="text" class="form-control" value="{$result.tomb_num}" disabled>
                    </div>
                    <label class="control-label">具体位置</label>
                    <div class="col-md-2"  style="width: 28.5%">
                        <input type="text" class="form-control" style="width:100%;" value="{$result.tomb_region}{$result.tomb_address}" disabled>
                    </div>
                    <label class="control-label">墓穴规制</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.tomb_regulation_name}" disabled>
                    </div>
                    <label class="control-label">收敛形式</label>
                    <div class="col-md-2" style="width: 11%">
                        <input type="text" class="form-control" value="{$result.convergence}" disabled>
                    </div>
                </div>
            </div>
            <!---tab页-->
            <ul class="nav_tabs">
                <li class="active" id="change_li"><a href="javascript:">变更登记</a></li>
                <li id="loss_li"><a href="javascript:">挂失登记</a></li>
                <li><a href="javascript:">审核意见</a></li>
                <li><a href="javascript:">历史记录</a></li>
                <!--<li><a href="javascript:">逝者信息</a></li>-->
            </ul>
            <div class="control-group1-p nav_content">
            	<div class="content_nav">
                    <div class="p_title">
                        <span class="span_title">变更信息</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered">
                        <thead>
                            <tr>
                                <th>原持证人</th>
                                <th>性别</th>
                                <th>手机号码</th>
                                <th>证件类型</th>
                                <th >证件号码</th>
                                <th >联系地址</th>
                                <th >证件上传</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                            	<td>
                                    <input type="text" class="form-control" disabled name="customer[old_name]" value="{$result.buyer_name|default=''}">
                                </td>
                                <td>
                                    <select name="customer[deceased_sex]"disabled class="form-control">
                                        <option value="男"<if condition=" $result['buyer_sex'] eq 1"> selected </if>>男</option>
                                        <option value="女"<if condition=" $result['buyer_sex'] eq 2"> selected </if>>女</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" disabled name="customer[buyer_phone]" value="{$result.buyer_phone|default=''}"></td>
                                <td>
                                    <select name="customer[cart_type]" disabled class="form-control">
                                        <option value="1">身份证</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" disabled name="customer[customer_account]" value="{$result.customer_account|default=''}"></td>
								<td><input type="text" class="form-control" disabled name="customer[customer_address]" value="{$result.customer_address|default=''}"></td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($result['cart_upload'])?$result['cart_upload']:'');</php>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}"  id="cart_file-preview" style="cursor: hand"/>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                    <table class="table table-hover table-bordered">
                        <thead>
                            <tr>
                                <th>新持证人</th>
                                <th>性别</th>    
                                <th>手机号码</th>                                                                    
                                <th></th>
                                <th>验证码</th>                        
                                <th >证件类型</th>
                                <th >证件号码</th>
                                <th >联系地址</th>
                                <th >证件上传</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                            	<td>
                                    <input type="hidden" class="form-control" name="change[old_name]" value="{$result.buyer_name|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_sex]" value="{$result.old_sex|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_phone]" value="{$result.old_phone|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_cart_type]" value="1">
                                    <input type="hidden" class="form-control" name="change[old_cart_ID]" value="{$result.customer_account|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_cart_upload]" value="{$result.cart_upload|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_cart_upload_id]" value="{$result.cart_upload_id|default=''}">
                                    <input type="hidden" class="form-control" name="change[old_customer_address]" value="{$result.customer_address|default=''}">
                                    <input type="text" class="form-control" name="change[name]" value="{$change['name']}" required>
                                    <input type="hidden" name="change[type]" value="1">
                                </td>
                                <td>
                                    <select name="change[sex]" class="form-control">
                                        <option value="1"<if condition=" $change['sex'] eq 1"> selected </if>>男</option>
                                        <option value="2"<if condition=" $change['sex'] eq 2"> selected </if>>女</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" name="change[phone]" value="{$change['phone']}"></td>
                                <td>
                                    <div class="btn btn-primary codeIput" data-k="1" data-wait-msg="[second]后才能再次获取"
                                       data-url="{:url('ajax')}">发送验证码</div>

                                </td>
                                <td><input type="text" class="form-control" name="change[verification_code]" value="" placeholder="请输入验证码"></td>
                                <td>
                                    <select name="change[cart_type]" class="form-control" required>
                                        <option value="1"<if condition=" $change['cart_type'] eq 1"> selected </if>>身份证</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" name="change[cart_ID]" required value="{$change['cart_ID']}"></td>
								<td><input type="text" class="form-control" name="change[customer_address]" required value="{$change['customer_address']}"></td>
                                <td>
                                    <php>$img_url=cmf_get_image_preview_url(isset($change['cart_upload'])?$change['cart_upload']:'');</php>
                                    <input type="hidden" name="change[cart_upload_id]" id="cart_upload-file_id" value="{$change.cart_upload_id|default=''}">
                                    <input type="hidden" name="change[cart_upload]" id="cart_upload" value="{$change.cart_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#cart_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" required class="preview" id="cart_upload-preview" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                  <div class="p_title">
                        <span class="span_title">变更资料</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered" >
                        <thead>
                            <tr>
                                <th>变更原因</th>
                                <th>变更时间</th>    
                                <th>变更业务表</th>                                                                    
                                <th>墓穴使用合同</th>
                                <th>墓穴安葬证</th>
                                <th>关系证明</th>
                                <th>原件回收作废</th>
                                <th>经办人</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    <select name="change[change_reason]" required class="form-control" style="width:180px;">
                                        <option value="0"<if condition=" $change['change_reason'] eq 0"> selected </if>>（注册人）已故</option>
                                        <option value="1"<if condition=" $change['change_reason'] eq 1"> selected </if>>亲属变更</option>
                                        <option value="2"<if condition=" $change['change_reason'] eq 2"> selected </if>>配偶变更</option>
                                        <option value="3"<if condition=" $change['change_reason'] eq 3"> selected </if>>子女变更</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control js-datetime date" required name="change[change_time]"value="<notempty name=" $change['change_time']"><php> echo date('Y-m-d H:i', $change['change_time'])</php></notempty>"></td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($change['business_upload'])?$change['business_upload']:'');</php>
                                    <input type="hidden" name="change[business_upload_id]" id="business_upload-file_id" value="{$change.business_upload_id|default=''}">
                                    <input type="hidden" name="change[business_upload]" id="business_upload" value="{$change.business_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#business_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="business_upload-preview" />
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($change['contract_upload'])?$change['contract_upload']:'');</php>
                                    <input type="hidden" name="change[contract_upload_id]" id="contract_upload-file_id" value="{$change.contract_upload_id|default=''}">
                                    <input type="hidden" name="change[contract_upload]" id="contract_upload" value="{$change.contract_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#contract_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="contract_upload-preview" />
                                </td>
								<td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($change['burial_upload'])?$change['burial_upload']:'');</php>
                                    <input type="hidden" name="change[burial_upload_id]" id="burial_upload-file_id" value="{$change.burial_upload_id|default=''}">
                                    <input type="hidden" name="change[burial_upload]" id="burial_upload" value="{$change.burial_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#burial_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="burial_upload-preview" />
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($change['relation_upload'])?$change['relation_upload']:'');</php>
                                    <input type="hidden" name="change[relation_upload_id]" id="relation_upload-file_id" value="{$change.relation_upload_id|default=''}">
                                    <input type="hidden" name="change[relation_upload]" id="relation_upload" value="{$change.relation_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#relation_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="relation_upload-preview" />
                                </td>
                                <td>
                                    <div class="btn btn-primary" id="check-btn">确认</div>
                                    <input type="hidden" value="{$change.if_recycle|default='2'}" id="if_recycle" name="change[if_recycle]">
                                </td>
                                <td>
                                    <input type="text" class="form-control" value="{$add_user}" disabled>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                  <div class="form-actions">
                        <div class="btn btn-warning print_bg" data-k="1">打印变更登记表</div>
                        <div class="btn btn-primary check-save">保存</div>
                        <div class="btn btn-primary check-approval">提交审核</div>
                    </div>
                </div>
                <!--挂失登记-->
                <div class="content_nav feature">
                	<div class="p_title">
                        <span class="span_title">挂失人信息</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered">
                        <thead>
                            <tr>
                                <th>挂失人</th>
                                <th>性别</th>    
                                <th>手机号码</th>                                                                    
                                <th></th>
                                <th>验证码</th>                        
                                <th>证件类型</th>
                                <th>证件号码</th>
                                <th>联系地址</th>
                                <th>证件上传</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                            	<td>
                                    <input type="text" class="form-control" name="loss[name]" value="{$loss['name']}" required>
                                    <input type="hidden" name="loss[type]" value="2">
                                </td>
                                <td>
                                    <select name="loss[sex]" class="form-control">
                                        <option value="1"<if condition=" $loss['sex'] eq 1"> selected </if>>男</option>
                                        <option value="2"<if condition=" $loss['sex'] eq 2"> selected </if>>女</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" name="loss[phone]" value="{$loss['phone']}"></td>
                                <td>
                                    <div class="btn btn-primary codeIput" data-k="2" data-wait-msg="[second]后才能再次获取"
                                          data-url="{:url('ajax')}">发送验证码</div>
                                    </td>
                                <td><input type="text" class="form-control" name="loss[verification_code]" value="" placeholder="请输入验证码"></td>
                                <td>
                                    <select name="loss[cart_type]" class="form-control">
                                        <option value="1"<if condition=" $change['cart_type'] eq 1"> selected </if>>身份证</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control" required name="loss[cart_ID]" value="{$loss['cart_ID']}"></td>
								<td><input type="text" class="form-control" required name="loss[customer_address]" value="{$loss['customer_address']}"></td>
                                <td>
                                    <php>$img_url=cmf_get_image_preview_url(isset($loss['cart_upload'])?$loss['cart_upload']:'');</php>
                                    <input type="hidden" name="loss[cart_upload_id]" id="cart_upload1-file_id" value="{$loss.cart_upload_id|default=''}">
                                    <input type="hidden" name="loss[cart_upload]" id="cart_upload1" value="{$loss.cart_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#cart_upload1','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" required class="preview" id="cart_upload1-preview" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                    <div class="p_title">
                        <span class="span_title">挂失资料</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered" >
                        <thead>
                            <tr>
                                <th>挂失原因</th>
                                <th>挂失时间</th>
                                <th>工本费</th>
                                <th>挂失业务表</th>                                                                    
                                <th>付款凭证</th>                                                       
                                <th>关系证明</th>
                                <th>登报声明</th> 
                                <th>经办人</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td><select name="loss[change_reason]" style="width:180px;" class="form-control">
                                        <option value="0"<if condition=" $change['change_reason'] eq 0"> selected </if>>损毁</option>
                                        <option value="1"<if condition=" $change['change_reason'] eq 1"> selected </if>>遗失</option>
                                    </select>
                                </td>
                                <td><input type="text" class="form-control js-datetime date" name="loss[change_time]" value="<notempty name=" $loss['change_time']"><php> echo  date('Y-m-d H:s', $loss['change_time'])</php></notempty>"></td>
                                <td>
                                    <input type="text" class="form-control" value="{$id_cost} 元/次" disabled>
                                    <input type="hidden" class="form-control" name="loss[cost]" value="{$id_cost}">
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($loss['business_upload'])?$loss['business_upload']:'');</php>
                                    <input type="hidden" name="loss[business_upload_id]" id="business_upload1-file_id" value="{$loss.business_upload_id|default=''}">
                                    <input type="hidden" name="loss[business_upload]" id="business_upload1" value="{$loss.business_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#business_upload1','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="business_upload1-preview" />
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($loss['payment_upload'])?$loss['payment_upload']:'');</php>
                                    <input type="hidden" name="loss[payment_upload_id]" id="payment_upload-file_id" value="{$loss.payment_upload_id|default=''}">
                                    <input type="hidden" name="loss[payment_upload]" id="payment_upload" value="{$loss.payment_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#payment_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="payment_upload-preview" />
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($loss['newspaper_upload'])?$loss['newspaper_upload']:'');</php>
                                    <input type="hidden" name="loss[newspaper_upload_id]" id="newspaper_upload-file_id" value="{$loss.newspaper_upload_id|default=''}">
                                    <input type="hidden" name="loss[newspaper_upload]" id="newspaper_upload" value="{$loss.newspaper_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#newspaper_upload','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="newspaper_upload-preview" />
                                </td>
                                <td>
                                    <php>$img_urls=cmf_get_image_preview_url(isset($loss['relation_upload'])?$loss['relation_upload']:'');</php>
                                    <input type="hidden" name="loss[relation_upload_id]" id="relation_upload1-file_id" value="{$loss.relation_upload_id|default=''}">
                                    <input type="hidden" name="loss[relation_upload]" id="relation_upload1" value="{$loss.relation_upload|default=''}">
                                    <a href="javascript:gpyUploadOneImage('拍照上传', '#relation_upload1','{$result.tomb_num}');">
                                        <h5 class="btn btn-primary">拍照上传</h5>
                                    </a>
                                    <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="relation_upload1-preview" />
                                </td>
                                <td><input type="text" class="form-control" value="{$add_user}" disabled></td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                  <div class="form-actions">
                      <div class="btn btn-warning   print_bg" data-k="2">打印挂失登记表</div>
                      <div class="btn btn-primary check-save">保存</div>
                      <div class="btn btn-primary check-approval">提交审核</div>
                    </div>
                </div>
                <div class="content_nav check_nav feature" style="">
                    <if ($approval.approval_status)==1>
                        <div class="check_info">
                            <P style="color:#0b7ebf">您的<if condition="$approval['detail_type'] eq 5">变更业务<else/>挂失业务</if>已于<php>echo date('Y-m-d H:i', $approval['apply_time'])</php>成功提交</P>
                            <P>申请处理中，请耐心等待！</P>
                            <div class="btn btn-primary">查看提交内容</div>
                        </div>
                    </if>
                    <if ($approval.approval_status)==2>
                        <div class="check_info">
                            <img src="__TMPL__/Public/assets/images/agree.jpg" />
                            <P style="color:#4ABD41;font-size:20px;">您的<if condition="$approval['detail_type'] eq 5">变更业务<else/>挂失业务</if>已申请通过</P>
                            <P style="color:#999999;">2019-12-13 14：35：56</P>
                        </div>
                    </if>
                    <if ($approval.approval_status)==3>
                        <div class="check_info">
                            <img src="__TMPL__/Public/assets/images/warn.jpg" />
                            <P style="color:#EE860A;font-size:20px;">您的<if condition="$approval['detail_type'] eq 5">变更业务<else/>挂失业务</if>已未申请通过</P>
                            <P style="color:#999999;">2019-12-13 14：35：56</P>
                            <div style="padding:5px;max-width:200px;border:1px solid #f2f2f2;">未通过原因：{$approval['approval_desc']}</div>
                        </div>
                    </if>
                </div>
                <!--历史记录-->
                <div class="content_nav feature">
                	<div class="p_title">
                        <span class="span_title">操作记录</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered"  style="max-width: 160% !important;width: 160% !important;">
                        <thead>
                            <tr>
                            	<td width="20">
                                    <input type="checkbox" class="js-check-all" data-direction="y" data-checklist='orderid' />
                                </td>
                                <th>操作时间</th>
                                <th>办理人信息</th>    
                                <th>业务类型</th>                                                                    
                                <th>办理原因</th>
                                <th>经办人</th>
                                <th>购买凭证</th>
                                <th >关系证明</th>
                                <th >登报声明</th>
                                <th >墓穴使用合同</th>
                                <th >墓穴安葬证</th>
                                <th >原持证人身份证</th>
                                <th >新持证人身份证</th>
                                <th>火化证明</th>
                            </tr>
                        </thead>
                        <tbody id="log_list">
                        <foreach name="log_list" item="vo">
                            <tr >
                            	<td width="20">
                                    <input type="checkbox" class="payid js-check-all " data-direction="y" data-payId="{$vo.pay_id}" data-checklist='orderid' />
                                </td>
                                <td><php>echo date('Y-m-d', $vo['add_time'])</php></td>
                                <td>
                                    <a href="javascript:" class="lookCustomer" data-title="办理人信息" data-url="?t=8&id={$vo.id}">点击查看</a>
                                </td>
                                <td>{$vo.type_name}</td>
                                <td>{$vo.change_reason}</td>
                                <td>{$vo.user_nickname}</td>
                                <!--<td><a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">查看</a> | <a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">导出</a></td>-->
                                <!--<td><a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">查看</a> | <a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">导出</a></td>-->
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['payment_upload'])?$vo['payment_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['relation_upload'])?$vo['relation_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['newspaper_upload'])?$vo['newspaper_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['contract_upload'])?$vo['contract_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['burial_upload'])?$vo['burial_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['old_cart_upload'])?$vo['old_cart_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['cart_upload'])?$vo['cart_upload']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <td>
                                    <if ($vo.type)==2>
                                        <php>$img_urls=cmf_get_image_preview_url(isset($image['cremation_upload'])?$image['cremation_upload']:'');</php>
                                        <input type="hidden" name="image[cremation_upload_id]" id="cremation_upload-file_id" value="{$image.cremation_upload_id|default=''}">
                                        <input type="hidden" name="image[cremation_upload]" id="cremation_upload" value="{$image.cremation_upload|default=''}">
                                        <a href="javascript:gpyUploadOneImage('拍照上传', '#cremation_upload','{$result.tomb_num}');">
                                            <h5 class="btn btn-primary">拍照上传</h5>
                                        </a>
                                        <img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_urls}" class="preview" id="cremation_upload-preview" />
                                    </if>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                  <div class="form-actions">
                        <div class="btn btn-primary print">补打结算单</div>
                        <div class="btn btn-primary">补打登记</div>
                  </div>
                </div >
                <!--逝者信息-->
                <div class="content_nav feature">
                	<div class="p_title">
                        <span class="span_title">逝者信息</span>
                    </div>
                    <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;margin:0 20px;overflow:hidden; overflow-x:auto;">
                    <table class="table table-hover table-bordered" style="max-width: 120% !important;width: 120% !important;">
                        <thead>
                            <tr>
                            	<td width="20">
                                    <input type="checkbox" class="js-check-all" data-direction="y" data-checklist='orderid' />
                                </td>
                                <th>逝者姓名</th>
                                <th>性别</th>    
                                <th>生卒日期</th>                                                                    
                                <th>落葬时间</th>
                                <th>收敛形式</th>                        
                                <th>落葬类别</th>
                                <th>与持证人关系</th>
                                <th>火化证明</th>
                                <th>办理人信息</th>
                                <th>接待人</th>
                                <th>执行情况</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name="deceased_list" item="vo">
                            <tr>
                            	<td width="20">
                                    <input type="checkbox" class="js-check-all" data-direction="y" data-checklist='orderid' />
                                </td>
                                <td>{$vo.deceased_name}</td>
                                <td>{$vo.gender}</td>
                                <td>{$vo.date_birth} - {$vo.date_death}</td>
                                <td>{$vo.date_funeral}</td>
                                <td>{$vo.convergence_type}</td>
                                <td>{$vo.type}</td>
                                <td>{$vo.relationship_users}</td>
                                <php>$img_url=cmf_get_image_preview_url(isset($vo['cremation_certificate'])?$vo['cremation_certificate']:'');</php>
                                <td><img style="cursor: pointer; height: 50px" onclick="parent.imagePreviewDialog(this.src);"  src="{$img_url}" class="preview"/></td>
                                <td>
                                    <a href="javascript:" class="lookCustomer" data-title="办理人信息" data-url="?t=8&id={$vo.id}">点击查看</a>
                                </td>
                                <td>{$vo.receptionist}</td>
                                <td>{$vo.service_status}</td>
                            	<td><a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">工单查看</a> | <a href="{:url('Aftersale/edit',array('id'=>$vo['id']))}">工单导出</a></td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    <div class="pagination">{$page}</div>
                  </div>
                  <!--<div class="form-actions">
                  <div class="btn btn-primary" id="check-btn">补打结算单</div>
                        <div class="btn btn-primary" id="check-btn">补打登记</div>
                    </div>-->
                </div>
            </div>
        </div>
        </fieldset>
        </form>
    </div>

<div id="print_html" style="display: none"></div>
<script type="text/javascript" src="__STATIC__/js/lodop/LodopFuncs.js?v={:time()}"></script>
    <script type="text/javascript" src="__STATIC__/js/print.js?1"></script>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
<script type="text/javascript" src="__STATIC__/js/init_base.js?v={:time()}"></script>
<script type="application/javascript">
	//切换显示
	$(document).on('click','.nav_tabs li',function(){
		$(this).addClass('active').siblings().removeClass('active');
		var index = $(".nav_tabs li").index(this);
		if($(this).attr("id") == "change_li"){
            $("#types").val("change");
        }else if($(this).attr("id") == "loss_li"){
            $("#types").val("loss");
        }
		billtype = index;
		$('.content_nav').eq(index).removeClass("feature").siblings().addClass("feature");
    });

	$(".codeIput").click(function () {
        var $this = $(this);
        var k = $this.data('k');
        if (k == 1){
            var phone = $("input[name='change[phone]']").val()
        } else if (k == 2) {
            var phone = $("input[name='loss[phone]']").val()
        }
        if (phone == ''){
            layer.msg('请填写手机号！',{icon: 3});
        }else {
            var init_secode_left = parseInt($this.data('init-second-left'));
            init_secode_left = init_secode_left > 0 ? init_secode_left : 60;
            var init_text = $this.text();
            $this.data('second-left', init_secode_left);
            var wait_msg = $this.data('wait-msg')
            $.ajax({
                url: "{:url('ajax')}",
                type: 'get',
                dataType: 'json',
                data: {t: 12, phone: phone},
                success: function (data) {
                    if (data.code == 1) {
                        layer.msg('验证码发送成功！');
                        $this.text(wait_msg.replace('[second]', init_secode_left));
                        var mtimer = setInterval(function () {
                            if (init_secode_left > 0) {
                                init_secode_left--;
                                $this.text(wait_msg.replace('[second]', init_secode_left));
                                $this.attr('disabled', true)
                            } else {
                                clearInterval(mtimer);
                                $this.text(init_text);
                                $this.data('sending', false);
                                $this.attr('disabled', false)
                            }
                        }, 1000);
                    } else {
                        layer.msg(data.msg);
                        $this.data('sending', false);
                    }
                }
            })
        }
    })
	$(".print_bg").click(function () {
        var title = $(this).text();
        var docx = $(this).data('url');
        var k = $(this).data('k');
        if (k==1){
            var url = 'https://view.officeapps.live.com/op/view.aspx?src=http://gd.zhmyxt.com/document/contract/安葬证-变更.docx';
        } else {
            if ("{$tomb_typei}" == 1){
                var url = 'https://view.officeapps.live.com/op/view.aspx?src=http://gd.zhmyxt.com/document/contract/寄存证-挂失.docx';
            } else {
                var url = 'https://view.officeapps.live.com/op/view.aspx?src=http://gd.zhmyxt.com/document/contract/安葬证-挂失.docx';
            }
        }
	    RCABase.initBase.ajaxLayerIframeOpen(title,url,['50%','90%'])
    })

    $('.print').on('click',function(){
        var payId = $("#log_list").find('.payid:checked').attr('data-payId');
        console.log(payId)
        if (payId !=0) {
            $.ajax({
                type: "get", url:"{:url('Print/print_cert')}?type=3&pay_id="+payId,
                success: function (strHtml) {
                    console.log('打印')
                    var data = strHtml.data;
                    $('#print_html').html(data.html)
                    preViewPrint('服务结算单',3,7)
                }
            })
        }else {
            layer.msg('清选择打印的数据');
        }

        // var idlist = $('#table_records').bootstrapTable('getAllSelections');
        // idarr=[];
        // for(i = 0; i < idlist.length; i++){
        //     idarr.push(idlist[i].id);
        // }
        // if(idarr.length<1){
        //     layer.msg('清选择打印的数据');
        //     return;
        // }
        // $.post("{:url('Stamp/print_cert')}",{'type':7,'mark':2,'itype':7},function(result){
        //     if(result.status==1){
        //         var f = document.getElementById('printf');
        //         f.contentDocument.write(result.html);
        //         f.contentDocument.close();
        //         f.contentWindow.print();
        //         return false;
        //     }
        // },'json')
    })


    $(document).on('click','#check-btn',function(){
        if($("#if_recycle").val() == 1){
            $("#if_recycle").val("2");
            $(this).html("确认");
        }else{
            $("#if_recycle").val("1");
            $(this).html("取消确认");
        }
    })
	var index;
    // 提交保存
    $(".check-save").click(function(){
        // 判断是变更还是挂失
        if($('#types').val() == "change"){
            var name = $("input[name='change[name]']").val();
            if(name == null || name ==""){
                layer.msg('新持证人姓名不能为空！',{icon: 3,});
                //alert("新持证人姓名不能为空！");
                return;
            }
            var phone = $("input[name='change[phone]']").val();
            if(phone == null || phone ==""){
                layer.msg('新持证人手机号不能为空！',{icon: 3,});
                // alert("新持证人手机号不能为空！");
                return;
            }
            var cart_ID = $("input[name='change[cart_ID]']").val();
            if(cart_ID == null || cart_ID ==""){
                alert("新持证人证件号码不能为空！");
                return;
            }
        }else{
            var name = $("input[name='loss[name]']").val();
            if(name == null || name ==""){
                alert("挂失人姓名不能为空！");
                return;
            }
            var phone = $("input[name='loss[phone]']").val();
            if(phone == null || phone ==""){
                alert("挂失人手机号不能为空！");
                return;
            }
            var cart_ID = $("input[name='loss[cart_ID]']").val();
            if(cart_ID == null || cart_ID ==""){
                alert("挂失人证件号码不能为空！");
                return;
            }
        }
        $("#status").val(0);
        $.post($(".form-horizontal").attr('action'), $(".form-horizontal").serialize(), function(result){
            if(result.code == 1){
                layer.alert('提交成功。', {icon: 1, yes: function (index) {
                        layer.close(index);
                        window.location.href = result.url;
                    }})
            } else {
                layer.msg(result.msg,{icon: 5});
            }
        }, 'json');
    });
    $(".check-approval").click(function(){
        // 判断是变更还是挂失
        if($('#types').val() == "change"){
            var name = $("input[name='change[name]']").val();
            if(name == null || name ==""){
                alert("新持证人姓名不能为空！");
                return;
            }
            var phone = $("input[name='change[phone]']").val();
            if(phone == null || phone ==""){
                alert("新持证人手机号不能为空！");
                return;
            }
            var cart_ID = $("input[name='change[cart_ID]']").val();
            if(cart_ID == null || cart_ID ==""){
                alert("新持证人证件号码不能为空！");
                return;
            }
            var cart_upload = $("input[name='change[cart_upload]']").val();
            if(cart_upload == null || cart_upload ==""){
                alert("新持证人证件必须上传！");
                return;
            }
            var address = $("input[name='change[customer_address]']").val();
            if(address == null || address ==""){
                alert("新持证人联系地址不能为空！");
                return;
            }
            var change_time = $("input[name='change[change_time]']").val();
            if(change_time == null || change_time ==""){
                alert("变更时间不能为空！");
                return;
            }
        }else if($('#types').val() == "loss"){
            var name = $("input[name='loss[name]']").val();
            if(name == null || name ==""){
                alert("挂失人姓名不能为空！");
                return;
            }
            var phone = $("input[name='loss[phone]']").val();
            if(phone == null || phone ==""){
                alert("挂失人手机号不能为空！");
                return;
            }
            var cart_ID = $("input[name='loss[cart_ID]']").val();
            if(cart_ID == null || cart_ID ==""){
                alert("挂失人证件号码不能为空！");
                return;
            }
            var cart_upload = $("input[name='loss[cart_upload]']").val();
            if(cart_upload == null || cart_upload ==""){
                alert("挂失人证件必须上传！");
                return;
            }
            var address = $("input[name='loss[customer_address]']").val();
            if(address == null || address ==""){
                alert("挂失人联系地址不能为空！");
                return;
            }
            var change_time = $("input[name='loss[change_time]']").val();
            if(change_time == null || change_time ==""){
                alert("挂失时间不能为空！");
                return;
            }
            var cost = $("input[name='loss[cost]']").val();
            if(cost == null || cost ==""){
                alert("工本费不能为空！");
                return;
            }
        }else{
            return;
        }
        $("#status").val(1);
        $.post($(".form-horizontal").attr('action'), $(".form-horizontal").serialize(), function(result){
            if(result.code == 1){
                layer.alert('提交成功。', {icon: 1, yes: function (index) {
                        layer.close(index);
                        window.location.href = result.url;
                    }})

                // alert("提交成功！");
                layer.alert('提交成功', { icon: 5 });
                window.location.href = result.url;
            } else {
                layer.msg(result.msg,{icon: 3,});
                // alert(result.msg);
            }
        }, 'json');

    });
</script>

</body>
</html>